<?php

namespace app\adminapi\controller\v1\setting\admin;

use app\adminapi\controller\AuthController;
use app\services\setting\admin\SystemWebsiteService;
use think\facade\App;

class SystemWebsit extends AuthController
{

    public function __construct(App $app,SystemWebsiteService $service)
    {
        parent::__construct($app);
        $this -> services = $service;
    }

    public function index(){
        $where = $this->request->getMore([
            ['page',1],
            ['pageSize',20]
        ]);
        return app() -> make('json') -> successful($this -> services -> index($where));
    }

    public function create(){
        $where = $this->request->getMore([
            ['site',''],
            ['name','']
        ]);
        return app() -> make('json') -> successful($this -> services -> create($where));
    }

    public function update(){
        $where = $this->request->getMore([
            ['id',''],
            ['site',''],
            ['name','']
        ]);
        return app() -> make('json') -> successful($this -> services -> update($where));
    }

    public function delete(){
        $where = $this->request->getMore([
            ['id',''],
        ]);
        return app() -> make('json') -> successful($this -> services -> delete($where));
    }



}